<html>
    
    <body>
        
        <h1>rrex - a readable regular expression library</h1>
        
<h2>Intro</h2>
First the inevitable famous quote

Some people, when confronted with a problem, think 
"I know, I'll use regular expressions." Now they have two problems.

--- attributed to Jamie Zawinski in 1997 
(read the full history here: http://regex.info/blog/2006-09-15/247)

rrex is a Java port of Joshua Flanagan's Readable Regular Expressions C# library

See: http://flimflan.com/blog/ReadableRegularExpressions.aspx

The idea is to allow a programmer to express regular expressions is a syntax that 
fits with a programming language rather than use a completely different syntax.

The main point about regular expressions is that they are often hard to write and 
even harder to read especially if some time has elapsed since they were written 

<h2>Example</h2>

Here's an example of a regular expression matching social security numbers:

^\d{3}-?\d{2}-?\d{4}$

In rrex it would look like this

RRex socialSecurityNumber = RRex.With().AtBeginning()
.Digit().Repeat().Exactly(3)
.Literal("-").Repeat().Optional()
.Digit().Repeat().Exactly(2)
.Literal("-").Repeat().Optional()
.Digit().Repeat().Exactly(4)
.AtEnd();

Certainly wordier but I think more readable and therefore more maintanable.

You may disagree. 

This is really a matter of taste, a lot of people really like regex syntax and I'm not 
going to argue about what is better. I just plan to use this library in a number of 
projects and see whether it makes working with regex's easier or harder.

        <h2>license</h2>
        
        Copyright 2008 by John Hardy jh@lagado.com http://www.lagado.com. 
        This code has released under the MIT License with the permission of its original author .
    </body>
</html>	